package Before826.Synchronized;

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        MyThread1 Thread1 = new MyThread1();
        MyThread2 Thread2 = new MyThread2();
        Thread1.start();
        Thread2.start();
        CountThread c = new CountThread();
        c.start();
        Scanner input = new Scanner(System.in);
        System.out.println("请输入");
        while (true) {
            String s = input.nextLine();
            if (s.equals("s")) {
                c.interrupt();//调用方法终端计数线程
                break;
            }
        }
    }
}

